I need to access an object in a formal module for which I have a doors URL. I'm successfully using decodeURL to get the necessary information including the correct absno for the object. Next, I'm trying to access the object like this:
This fails, i.e. returns null if the current view is restricted to e.g. level 1 but the object is on some lower level, or if the current view is filtered. The documentation on the object perm doesn't mention that restriction on visible objects. Is this a bug or is there any other way to get an invisible object by its absno? This is used in a script which needs to iterate over a complete module, so I don't want to make each object visible by using gotoObject or forcing the user to turn off all filtering. vlke - Mon Apr 07 05:14:26 EDT 2014 |
Re: Getting object in module by absno only possible if visible? Not documented but yes, it is restricted to the display view. You may need to put the objects in a Skip:
If you figure to search only once then you don't need the Skip; but if you figure to search for a few modules the Skip is a lot more effecient than looping through the Module each time -Louie
|
Re: Getting object in module by absno only possible if visible? llandale - Mon Apr 07 13:31:43 EDT 2014 Not documented but yes, it is restricted to the display view. You may need to put the objects in a Skip:
If you figure to search only once then you don't need the Skip; but if you figure to search for a few modules the Skip is a lot more effecient than looping through the Module each time -Louie
A real pity that such essential info is missing from the docs :-( Thanks, Louie, for the skip list idea. In the hopes of it not happening too often, I first resorted to a linear search in the module whenever getting the object directly failed. I'll now create the skip list lazily on first failed access instead because that implies some filter being active and more hidden objects are likely to be encountered. Lars. |
Re: Getting object in module by absno only possible if visible? vlke - Mon Apr 07 15:09:28 EDT 2014 A real pity that such essential info is missing from the docs :-( Thanks, Louie, for the skip list idea. In the hopes of it not happening too often, I first resorted to a linear search in the module whenever getting the object directly failed. I'll now create the skip list lazily on first failed access instead because that implies some filter being active and more hidden objects are likely to be encountered. Lars. Yes, I dislike being subject to the whims of the current view. |